1. For non-GX-aware applications, the page size always is defaults to the fifth paper size. As a result, whichever paper type is the fifth one listed in the resource file that has the 'ptyp's in it becomes the default paper size in the GX compatibility driver. This is, of course, reflected in the Page Setup dialog.
2. The driver always defaults to having the "Print To File" checkbox on.
What can I do about these problems?
A Both of these quirks in the sample driver that you describe (improper default
paper type and the "Print to File" check box defaulting to on) can be fixed by
modifying the 'PREC' 0 resource in the driver.
When an old-style-printing application calls PrintDefault() to request the default old-style print record from the current printer driver, the driver gives it the contents of the 'PREC' 0 resource. Then, when the application calls PrJobDialog or PrStlDialog(), it passes in that print record. In its overrides, the GX printer driver interprets the contents of the old-style-printrecord in order to set up the states of the button, checkboxes, etc. in the old-style dialogs.
To determine which papertype radio button to select in the old-style page-setup dialog, QuickDraw GX compares the page rect of the old-style-printrecord to the rects of all the paper types in the driver (or paper-type extensions, such as "3-Hole Punch"), and tries to find the best match. Because of the way that the old-style-printrecord in the CustomDialogs sample is defined, that best match turns out to be the fifth paper type in your list. So, to fix this quirk, all you have to do is change the bounds setting in the 'PREC' 0 resource so that it matches the bounds of the US Letter papertype in the driver.
To determine the state of the "Print to disk" checkbox, the driver looks at the
UIOffset bit of the old-style-printrecord. (One might not think to look at this
bit, but old-style-printrecords are limited to 120 bytes, and there was no
better place for this driver to store this information.) Because the 'PREC' 0
resource in this driver has this bit set, the checkbox defaults to on. So, to
fix this quirk, all you have to do is set this bit off.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help